package com.lucker.ds.model;

import java.math.BigDecimal;

/**
 * plan_config
 * @author 
 */
public class PlanConfig extends BaseValueObject {
    private Long id;

    private String planId;

    private String planName;

    /**
     * 注数
     */
    private Long betCounts;

    /**
     * 中奖概率
     */
    private BigDecimal probability;

    /**
     * 最小中奖注数
     */
    private Integer minBonusCounts;

    /**
     * 最大中奖注数
     */
    private Integer maxBonusCounts;

    /**
     * 最小中奖金额
     */
    private Integer minBonusValue;

    /**
     * 最大中奖金额
     */
    private Integer maxBonusValue;

    /**
     * 目标盈利率
     */
    private BigDecimal targetProfitability;

    /**
     * 购买期数
     */
    private Integer buyerCount;

    private String caiTypeId;

    /**
     * 备注
     */
    private String remark;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPlanId() {
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public String getPlanName() {
        return planName;
    }

    public void setPlanName(String planName) {
        this.planName = planName;
    }

    public Long getBetCounts() {
        return betCounts;
    }

    public void setBetCounts(Long betCounts) {
        this.betCounts = betCounts;
    }

    public BigDecimal getProbability() {
        return probability;
    }

    public void setProbability(BigDecimal probability) {
        this.probability = probability;
    }

    public Integer getMinBonusCounts() {
        return minBonusCounts;
    }

    public void setMinBonusCounts(Integer minBonusCounts) {
        this.minBonusCounts = minBonusCounts;
    }

    public Integer getMaxBonusCounts() {
        return maxBonusCounts;
    }

    public void setMaxBonusCounts(Integer maxBonusCounts) {
        this.maxBonusCounts = maxBonusCounts;
    }

    public Integer getMinBonusValue() {
        return minBonusValue;
    }

    public void setMinBonusValue(Integer minBonusValue) {
        this.minBonusValue = minBonusValue;
    }

    public Integer getMaxBonusValue() {
        return maxBonusValue;
    }

    public void setMaxBonusValue(Integer maxBonusValue) {
        this.maxBonusValue = maxBonusValue;
    }

    public BigDecimal getTargetProfitability() {
        return targetProfitability;
    }

    public void setTargetProfitability(BigDecimal targetProfitability) {
        this.targetProfitability = targetProfitability;
    }

    public Integer getBuyerCount() {
        return buyerCount;
    }

    public void setBuyerCount(Integer buyerCount) {
        this.buyerCount = buyerCount;
    }

    public String getCaiTypeId() {
        return caiTypeId;
    }

    public void setCaiTypeId(String caiTypeId) {
        this.caiTypeId = caiTypeId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByPlanId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by plan_id asc";
            }else{
                this.orderStr = this.orderStr + ",plan_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by plan_id desc";
            }else{
                this.orderStr = this.orderStr + ",plan_id desc";
            }
        }
    }

    public void orderByPlanName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by plan_name asc";
            }else{
                this.orderStr = this.orderStr + ",plan_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by plan_name desc";
            }else{
                this.orderStr = this.orderStr + ",plan_name desc";
            }
        }
    }

    public void orderByBetCounts(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by bet_counts asc";
            }else{
                this.orderStr = this.orderStr + ",bet_counts asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by bet_counts desc";
            }else{
                this.orderStr = this.orderStr + ",bet_counts desc";
            }
        }
    }

    public void orderByProbability(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by probability asc";
            }else{
                this.orderStr = this.orderStr + ",probability asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by probability desc";
            }else{
                this.orderStr = this.orderStr + ",probability desc";
            }
        }
    }

    public void orderByMinBonusCounts(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by min_bonus_counts asc";
            }else{
                this.orderStr = this.orderStr + ",min_bonus_counts asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by min_bonus_counts desc";
            }else{
                this.orderStr = this.orderStr + ",min_bonus_counts desc";
            }
        }
    }

    public void orderByMaxBonusCounts(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by max_bonus_counts asc";
            }else{
                this.orderStr = this.orderStr + ",max_bonus_counts asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by max_bonus_counts desc";
            }else{
                this.orderStr = this.orderStr + ",max_bonus_counts desc";
            }
        }
    }

    public void orderByMinBonusValue(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by min_bonus_value asc";
            }else{
                this.orderStr = this.orderStr + ",min_bonus_value asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by min_bonus_value desc";
            }else{
                this.orderStr = this.orderStr + ",min_bonus_value desc";
            }
        }
    }

    public void orderByMaxBonusValue(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by max_bonus_value asc";
            }else{
                this.orderStr = this.orderStr + ",max_bonus_value asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by max_bonus_value desc";
            }else{
                this.orderStr = this.orderStr + ",max_bonus_value desc";
            }
        }
    }

    public void orderByTargetProfitability(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by target_profitability asc";
            }else{
                this.orderStr = this.orderStr + ",target_profitability asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by target_profitability desc";
            }else{
                this.orderStr = this.orderStr + ",target_profitability desc";
            }
        }
    }

    public void orderByBuyerCount(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by buyer_count asc";
            }else{
                this.orderStr = this.orderStr + ",buyer_count asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by buyer_count desc";
            }else{
                this.orderStr = this.orderStr + ",buyer_count desc";
            }
        }
    }

    public void orderByCaiTypeId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by cai_type_id asc";
            }else{
                this.orderStr = this.orderStr + ",cai_type_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by cai_type_id desc";
            }else{
                this.orderStr = this.orderStr + ",cai_type_id desc";
            }
        }
    }

    public void orderByRemark(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by remark asc";
            }else{
                this.orderStr = this.orderStr + ",remark asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by remark desc";
            }else{
                this.orderStr = this.orderStr + ",remark desc";
            }
        }
    }
}